﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BlockNews.ascx.cs" Inherits="ElectronicJournal.Control.BlockNews" %>
<%@ Import Namespace="ElectronicJournal.DB.Item" %>
<fieldset>
<legend>Новости</legend>

    <asp:Repeater ID="rptNews" runat="server" >
        <HeaderTemplate>
            <table border="0">
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <p>
                        <a href='../ViewNews.aspx?idNews=<%# ((ItemNews)Container.DataItem).idNews %>'><%# ((ItemNews)Container.DataItem).title %></a>
                        <br />
                        <% if (System.Web.HttpContext.Current.User.IsInRole("Administrator")) 
                           {
                        %>
                        <a href='../Admin/News.aspx?idNews=<%# ((ItemNews)Container.DataItem).idNews %>'>Редактировать</a>
                        <% } %>
                        <%# ((ItemNews)Container.DataItem).content %>
                    </p>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>

</fieldset>

